<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>不良品及验退超3天明细表</title>
    <link rel="stylesheet" href="/3nod_web/layui/css/layui.css" media="all">
    <link rel="stylesheet" type="text/css" href="/3nod_web/css/formSelects-v4.css"/>
</head>
<body>
<div id="content">
    <h1>不良品及验退超3天明细表&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <!--<a href="/3nod_web/exportSuppliedMaterials">-->
            <!--<button class="layui-btn  layui-btn-sm">导出</button>-->
        <!--</a>-->
    </h1>

    <form class="layui-form" action="javascript:;" id="myform">
        <div>
            <div class="layui-form-item" style="margin-top: 20px">
                <div class="layui-inline">
                    <label class="layui-form-label">据点</label>
                    <div class="layui-input-inline" style="width:168px;">
                        <input type="text" name="storerkey" id="storerkey" autocomplete="off"
                               class="layui-input"
                        >
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">品号</label>
                    <div class="layui-input-inline" style="width:168px;">
                        <input type="text" name="sku" id="sku" autocomplete="off"
                               class="layui-input"
                        >
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">逻辑仓</label>
                    <div class="layui-input-inline" style="width:168px;">
                        <input type="text" name="lottable01" id="lottable01" autocomplete="off"
                               class="layui-input"
                        >
                    </div>
                </div>

                <div class="layui-inline">
                    <button id="search" class="layui-btn layui-btn-sm">搜索</button>
                </div>
            </div>
        </div>
    </form>
</div>

<table class="layui-hide" id="demo" lay-filter="demo"></table>
<script src="/3nod_web/layui/layui.js" charset="utf-8"></script>
<script src="/3nod_web/js/jquery-1.8.3.js" charset="utf-8"></script>
<script src="/3nod_web/js/formSelects-v4.min.js" charset="utf-8"></script>
<script>


    layui.use('table', function () {
        var table = layui.table;

        //方法级渲染
        table.render({
            elem: '#demo'
            , url: '/3nod_web/report/getBadSkuOverThreeDays/'
            , cols: [
                [

                    {field: 'storerkey', title: '据点', fixed: true, sort: true, width: 100}
                    , {field: 'sku', title: '品号', fixed: true, sort: true, width: 150}
                    , {field: 'descr', title: '品名', width: 150}
                    , {field: 'default6', title: '规格', width: 350}
                    , {field: 'default7', title: '单位', width: 100}
                    , {field: 'qty', title: '数量', width: 100}
                    , {field: 'lottable01', title: '逻辑仓', width: 100}
                    , {field: 'loc', title: '储位', width: 100}
                    , {field: 'effectivedate', title: '单据日期', width: 130}
                    , {field: 'days', title: '天数', width: 100}

                ]
            ]
            , id: 'testReload'
            , page: true
            , height: 'full-170'
            , limits: [20, 50, 100, 200, 500, 1000, 2000, 3000, 4000, 5000]
            , limit: 20
        })

        var $ = layui.$, active = {
            reload: function () {
                var storerkey = $('#storerkey');
                var sku = $('#sku');
                var lottable01 = $('#lottable01');

                //执行重载
                table.reload('testReload', {
                    page: {
                        curr: 1 //重新从第 1 页开始
                    }
                    , where: {
                        storerkey: storerkey.val(),
                        sku: sku.val(),
                        lottable01: lottable01.val(),
                    }
                }, 'data');
            }
        };

        $('#search').on('click', function () {
            active['reload'] ? active['reload'].call(this) : '';
        });
        //按回车提交
        $(".layui-input-inline").keydown(function (e) {//当按下按键时
            if (e.which == 13) {//.which属性判断按下的是哪个键，回车键的键位序号为13
                active['reload'] ? active['reload'].call(this) : '';
            }
        });
    })
</script>

</body>
</html>